package com.moli.iov.alarm.enums;

/**
 * 报警管理 > 电子围栏报警 页签
 * The enum Fence tab type.
 * @author admin
 */
public enum AlarmTabEnum {
    /**
     * 全部
     */
    ALL(0,"全部"),
    /**
     * 待处理
     */
    UNTREATED(1,"待处理"),
    /**
     * 处理中
     */
    PROCESSING(2,"处理中"),
    /**
     * 已解除
     */
    DISMISSED(3,"已解除");


    private int code;

    private String cnName;

    public static AlarmTabEnum getEnum(int code){
        for(AlarmTabEnum e : AlarmTabEnum.values()){
            if(e.code == code){
                return e;
            }
        }
        return null;
    }

    private AlarmTabEnum(int code, String cnName) {
        this.code = code;
        this.cnName = cnName;
    }

    public int getCode() {
        return code;
    }

    public String getCnName() {
        return cnName;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setCnName(String cnName) {
        this.cnName = cnName;
    }
    public static String getCodeName(int code) {
        for (AlarmTabEnum e : AlarmTabEnum.values()) {
            if (e.code == code) {
                return e.cnName;
            }
        }
        return null;
    }
}
